Inside Macintosh: Imaging with QuickDraw

Previous | Chapter Top | Chapter Contents | Next

Using Offscreen Graphics Worlds

To use an offscreen graphics world, you generally

If you want to use the CopyMask or CopyDeepMask procedure, you can create another offscreen graphics world and draw your mask into that offscreen world.

These tasks are explained in greater detail in the rest of this chapter.

Before using the routines described in this chapter, you must use the InitGraf procedure, described in the chapter "Basic QuickDraw," to initialize QuickDraw. You should also ensure the availability of these routines by checking for the existence of System 7 or Color QuickDraw.

You can make sure that offscreen graphics world routines are available on any computer--including one supporting only basic QuickDraw--by using the Gestalt function with the gestaltSystemVersion selector. Test the low-order word in the response parameter; if the value is $0700 or greater, then offscreen graphics worlds are supported.

You can also test for offscreen graphics world support by using the Gestalt function with the gestaltQuickDrawVersion selector. If the value returned in the response parameter is equal to or greater than the value of the constant gestalt32BitQD , then the system supports both Color QuickDraw and offscreen graphics worlds.

You can use the Gestalt function with the gestaltQuickDrawVersion selector to determine whether the user's system supports offscreen color pixel maps. If the bit indicated by the gestaltHasDeepGWorlds constant is set in the response parameter, then offscreen color pixel maps are available.

For more information about the Gestalt function, see the chapter "Gestalt Manager" in Inside Macintosh: Operating System Utilities .

Creating an Offscreen Graphics World

Setting the Graphics Port for an Offscreen Graphics World

Drawing Into an Offscreen Graphics World

Copying an Offscreen Image Into a Window

Updating an Offscreen Graphics World

Creating a Mask and a Source Image in Offscreen Graphics Worlds


© 1997 Apple Computer, Inc.

Previous | Chapter Top | Chapter Contents | Next